#include<iostream>
using namespace std;
typedef long long LL;
const int N = 65;
LL a[N];
int main()
{
	int n;
	cin >> n;
	a[1] = 1 , a[2] = 2, a[3] = 4; 
	for(int i = 4; i <= n; i++)
	{
		a[i] = a[i - 1] + a[i - 2] + a[i - 3];
	}
	cout << a[n] << endl;
	return 0;
 } 
